{extend name="public/base"}

{block name="title"}
申请售后
{/block}

{block name="style"}
{css href="/static/wechat/css/refund.css" /}
{/block}

{block name="body"}
<div class="pageControl orderDetails">
    <div class="msui_nav msui_navTop" style="border-bottom: 1px solid #cccccc;">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">申请售后</h1>
    </div>

    <form action="{:url('save_austin')}" method="post" id="austin_form" class="iptform">
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <p class="fs08">退款金额(元)</p>
                </div>
                <div class="weui-cell__ft fs08 amount">{$data.return_money}</div>
                <input type="hidden" name="return_money" value="{$data.return_money}">
            </div>
        </div>

        <!--单选列表-->

        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <p class="refundreason">退款原因</p>
                </div>
                <div class="weui-cell__ft">&nbsp;</div>
            </div>
        </div>
        <div class="weui-cells weui-cells_radio" style="margin-top: 0rem;">
            <label class="weui-cell weui-check__label pding" for="x11">
                <div class="weui-cell__bd">
                    <p>不想修了</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" class="weui-check" name="cause" id="x11" value="不想修了" {eq name="data.cause" value="不想修了"} checked {/eq}>
                    <span class="weui-icon-checked ggco"></span>
                </div>
            </label>
            <label class="weui-cell weui-check__label pding" for="x12">

                <div class="weui-cell__bd">
                    <p>没修好</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" name="cause" class="weui-check" id="x12" value="没修好" {eq name="data.cause" value="没修好"} checked {/eq}>
                    <span class="weui-icon-checked"></span>
                </div>
            </label>
            <label class="weui-cell weui-check__label pding" for="x13">

                <div class="weui-cell__bd">
                    <p>店家服务态度恶劣</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" name="cause" class="weui-check" id="x13" value="店家服务态度恶劣" {eq name="data.cause" value="店家服务态度恶劣"} checked {/eq}>
                    <span class="weui-icon-checked"></span>
                </div>
            </label>
        </div>
        <!--用户退款输入详细原因-->
        <span class="cause">输入详细的原因</span>
        <textarea name="msg">{$data.msg}</textarea>

        <div class="weui-cells weui-cells_form" style="margin: 0rem;">
            {notempty name="data.img1"}
            <div class="scimg1 tjimg"> <img src="{$data.img1|get_img_url}" /> </div>
            {/notempty}
            {notempty name="data.img2"}
            <div class="scimg2 tjimg"> <img src="{$data.img2|get_img_url}" /> </div>
            {/notempty}
            {notempty name="data.img3"}
            <div class="scimg3 tjimg"> <img src="{$data.img3|get_img_url}" /> </div>
            {/notempty}
            <div class="weui-uploader__input-box">
                <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*"  file-attr="" />
            </div>
            <span class="imgnub  fs07">最多三张</span>
        </div>

        <!--服务单售后申请-->
        <input type="hidden" name="type" value="2">
        <!--申请提款-->
        <input type="hidden" name="audit_type" value="{$data.audit_type}">
        <input type="hidden" name="obj_id" value="{$data.obj_id}">
        <input type="hidden" name="img1" value="{$data.img1}">
        <input type="hidden" name="img2" value="{$data.img2}">
        <input type="hidden" name="img3" value="{$data.img3}">
        <input type="hidden" name="order_id" value="{$data.order_id}">
        <input type="hidden" name="product_id" value="{$data.product_id}">
        <input type="hidden" name="order_austin_id" value="{$data.id}">
        <!--提交按钮-->
        <button class="tijiao fs085" type="submit">提交</button>
    </form>
</div>
<div id="loadingToast" style="display:none;">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-loading weui-icon_toast"></i>
        <p class="weui-toast__content">数据加载中</p>
    </div>
</div>
{/block}

{block name="javascript"}
<script>
    $(function () {
        $("#uploaderInput").change(function(){
            $("#loadingToast").show();
            window.setTimeout(function() {
                upload_image('{:url("Base/get_upload_img")}', 'austin', 2);
            },666);
        });
    });
    $("#austin_form").submit(function (e) {
        e.preventDefault();
        var _this = $(this);
        $.ajax({
            type : 'POST',
            url : _this.attr('action'),
            data : _this.serialize(),
            dataType : 'json',
            success : function (msg) {
                if (msg.code == 200) {
                    alert('申请成功！')
                    window.location.href = '{:url("austin/index")}';
                } else {
                    var code = msg.code;
                    $.alert(error_code[code]);
                }
            }
        });
    });
</script>
{/block}